package com.hopu.v1.mapper.front.course;

import com.hopu.v1.pojo.course.FCourseHomeworkRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
* @author admin
* @description 针对表【t_course_homework_record(学生课程作业记录表)】的数据库操作Mapper
* @createDate 2024-10-09 20:11:28
* @Entity com.hopu.v1.pojo.course.CourseHomeworkRecord
*/
public interface FCourseHomeworkRecordMapper extends BaseMapper<FCourseHomeworkRecord> {

    /**
     * 查询布置的课后作业和学生回答（根据课程id和学生id）
     * @param courseId  课程id
     * @param studentId 学生id
     * @return
     */
    List<FCourseHomeworkRecord> selectHomeworkAndAnswerByCidAndSid(@Param("courseId") Long courseId, @Param("studentId") Long studentId);

    /**
     * 批量更新学生作业记录（根据课程id和学生id）
     * @param records
     */
    void updateBatchByHomeworkIdAndSId(List<FCourseHomeworkRecord> records);

    /**
     * 批量添加学生课程作业记录
     * @param records
     */
    void insertHomeworkBatch(List<FCourseHomeworkRecord> records);

    /**
     * 查询学生作业记录（根据学生id和课程作业id）
     * @param params
     * @return
     */
    List<FCourseHomeworkRecord> selectRecordBySIdAndHomeworkId(Map<Object, Object> params);
}




